﻿@using CNKI.TPI.Web.Base
@using CNKI.TPI.Web.Search.BLL
<!--面包屑一-->
<div class="crumbLink">
    @*<a href="Home">首页</a>&gt;<a href="javascript:void(0);">检索</a>&gt;期刊*@

</div>
@if (ViewBag.DetialField != null && @ViewBag.DetialField.Rows.Count > 0)
{
    <h2 class='doc-title'>@Html.Raw(ColumnAliasHelper.GetContent(ViewBag.DetialField, 0, 0))</h2>
    <div class="doc-value">
        @{
            string view = ColumnAliasHelper.GetContent(ViewBag.DetialField, @ViewBag.DbName, 0, "SYS_FLD_BROWSERATE");
            string download = ColumnAliasHelper.GetContent(ViewBag.DetialField, @ViewBag.DbName, 0, "SYS_FLD_DOWNLOADRATE");
        }
        浏览量：@Html.Raw(@view == "" ? "0" : @view)
        下载量：@Html.Raw(@download == "" ? "0" : @download)
        @{

            int type = (int)MediaType.Ebook;
            if (SessionHelper.HasDownloadRight(ViewBag.dbId))
            {

                if (ViewBag.FileCount != null && ViewBag.FileCount > 1)
                {
                    <a onclick="showdown()" class='btn btn-m btn-prim-f ml10'><i class="iconfont icon-download"></i>全文下载</a>
                }
                else
                {
                    <a onclick="javascript:isDown(@ViewBag.dbId, @ViewBag.recordId,@type, '@Html.Raw(Url.Action("IsShowDown", "File"))','-1','@ViewBag.DownType')" class='btn btn-m btn-prim-f ml10'>
                        <i class="iconfont icon-download"></i>全文下载
                    </a>
                }
            }
            if (SessionHelper.HasBrowseRight(ViewBag.dbId))
            {

                if (ViewBag.FileCountView != null && ViewBag.FileCountView > 1)
                {
                    <a onclick="showview()" class='btn btn-l btn-prim-f'>
                        <i class="iconfont icon-book"></i>在线预览
                    </a>
                }
                else
                {
                    <a onclick="javascript:isView(@ViewBag.dbId, '@ViewBag.DbName',@ViewBag.recordId,@type,'@Html.Raw(Url.Action("IsShowBrowse", "File"))','@ViewBag.ViewOnlineFileID','@ViewBag.DownType')" class='btn btn-m btn-warn-f'>
                        <i class="iconfont icon-book"></i>在线预览
                    </a>
                }

            }
            if (SessionHelper.GetUserInfo() != null
            && ((ConfigHelper.IsAnonymousControlEnabled() && SessionHelper.GetUserInfo().UserCode.ToUpper() != ConfigHelper.GetAnonymousAccount().ToUpper())
            || !ConfigHelper.IsAnonymousControlEnabled()))
            {
                <span class="favCate">
                    <a onclick="showFavCate('@ColumnAliasHelper.GetContent(ViewBag.DetialField, 0, 0)')" class='btn btn-m btn-prim-f ml10'><i class="iconfont icon-star"></i>收藏</a>
                </span>
            }
        }
    </div>
    @* “下载”弹层 *@
            <div class="talkDiv Down" style="top: 50%; left: 50%; margin-left: -280px; display: none">
                <div class="talkDiv-title" style="height: 40px; line-height: 40px; padding-left: 10px; font-size: 16px; position: relative; border-bottom: 1px solid #DADADA; background-color: #efefef; font-family: 微软雅黑">
                    <span>下载</span>
                    <a class="icon icon-close" title="关闭" href="javascript:void(0);" onclick="closedown()" style="top: 0px"><i class="iconfont icon-error3"></i></a>
                </div>
                <div class="talkDiv-body" style="padding-top: 25px">
                    <ul class="video-download">
                        @if (ViewBag.FileInfoAll != null)
                        {
                            foreach (CNKI.TPI.Web.Search.Model.METADATA_FILE m in ViewBag.FileInfoAll)
                            {

                                <li>
                                    @m.FILENAME
                                    <a class="btn btn-m btn-prim-f posa" style="margin-right:40px"
                                       onclick="javascript:isDown(@ViewBag.dbId, @ViewBag.recordId,@type, '@Html.Raw(Url.Action("IsShowDown", "File"))','@m.SYSID','@ViewBag.DownType')">点击下载</a>
                                </li>
                            }
                        }

                    </ul>
                </div>
            </div>
            @* “在线预览”弹层 *@
            <div class="talkDiv View" style="top: 105px; left: 250px; display: none">
                <div class="talkDiv-title" style="height: 40px; line-height: 40px; padding-left: 10px; font-size: 16px; position: relative; border-bottom: 1px solid #DADADA; background-color: #efefef; font-family: 微软雅黑">
                    <span>在线预览</span>
                    <a class="icon icon-close" title="关闭" href="javascript:void(0);" onclick="closeview()" style="top: 0px"><i class="iconfont icon-error3"></i></a>
                </div>
                <div class="talkDiv-body" style="padding-top: 25px">
                    <ul class="video-download">
                        @if (ViewBag.FileInfo != null)
                        {
                            foreach (CNKI.TPI.Web.Search.Model.METADATA_FILE m in ViewBag.FileInfo)
                            {
                                string hrefstr = Url.Action("DocView", "DocResource", new { dbName = @ViewBag.DbName, resourceId = m.SYSID, recordId = @ViewBag.recordId, dbId = @ViewBag.dbId, downType = @ViewBag.DownType });
                                <li>
                                    @m.FILENAME
                                    <a class="btn btn-m btn-prim-f posa" style="margin-right:40px"
                                       onclick="javascript:isView(@ViewBag.dbId, '@ViewBag.DbName',@ViewBag.recordId,@type, '@Html.Raw(Url.Action("IsShowBrowse", "File"))','@m.SYSID','@ViewBag.DownType')">在线预览</a>
                                </li>

                            }
                        }
                    </ul>
                </div>
            </div>
            <div class="doc-con clearfix posr video-con">
                <div class='video-con-r'>
                    <div class="video-con-r-in video-con-r-in2">
                        <p></p>
                        @foreach (System.Data.DataRow dr in ViewBag.DetialField.Rows)
                {
                    int i = 0;
                    System.Data.DataRow columnInfo = null;
                    foreach (System.Data.DataColumn column in ViewBag.DetialField.Columns)
                    {
                        if (column.ColumnName.StartsWith("SYS_FLD_") || column.ColumnName == "浏览量" || i == 0)
                        {
                            i++;
                            continue;
                        }
                        columnInfo = ViewBag.RColumnInfo.Select(string.Format("Name='{0}'", column.ColumnName))[0];
                        string colname = column.ColumnName;
                        if (!string.IsNullOrEmpty(columnInfo["DispName"].ToString()))
                        {
                            colname = columnInfo["DispName"].ToString();
                        }
                        if (!string.IsNullOrEmpty(dr[column.ColumnName].ToString()))
                        {
                                    <p>@colname：@Html.Raw(dr[column.ColumnName].ToString())</p>
                                }
                            }
                        }
                    </div>
                </div>
                <div class='video-con-l'>
                    <img width="185" height="247" src="@ViewBag.Pic" alt="" />
                </div>
            </div>


            <input type="hidden" id="dbID" name="dbID" value="@ViewBag.dbId" />
            <input type="hidden" id="recordId" name="recordId" value="@ViewBag.recordId" />
            <input type="hidden" id="mediaType" name="mediaType" value="@ViewBag.Type" />
            }
